<template>
  <div class="notice-container">
    <div class="notice-main">
      <div style="background-color: #f6f6f6">
        欢迎你加入本课程，
        <button class="to-learn" @click="gotoPage()">点我进入学习之旅吧</button>
      </div>
      <div class="notice-title">
        <span>{{ notice.title }}</span>
      </div>
      <div class="notice-content">
        <div v-html="notice.content"></div>
      </div>
      <div class="notice-time">
        {{ notice.time }}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Notice",
  props: ['notice'],
  data() {
    return {
      to: {
        name: "learn-content",
      },
    }
  },
  methods: {
    gotoPage() {
      this.$router.push(this.to);
    },
  }
}
</script>

<style scoped lang="scss">
.notice-container {
  padding: 10px;
  border-radius: 10px;
  background: #f6f6f6;
}

.notice-main {
  position: relative;
}

.to-learn {
  border: #f6f6f6 1px solid;
  background-color: #f6f6f6;
  color: #4c97ee;
  font-size: 18px;
  cursor: pointer;

  &:hover {
    color: #0672f1;
    transform: translateX(1px) translateY(1px);
  }
}

.notice-title {
  font-size: 18px;
  margin: 10px 0 0;
}

.notice-content {
  font-size: 14px;
  padding: 20px;
  line-height: 1.8;
}

.notice-time {
  font-size: 14px;
  position: absolute;
  right: 0;
  bottom: 0;
  color: #666666;
}
</style>
